package com.hawk.eye.server.constant;

/**
 * @className: AlarmConstant
 * @description:
 * @author: salad
 * @date: 2023/10/24
 **/
public final class AlarmConstant {

    public static final String ALARM_LEVEL = "alarmLevel";

    public static final String[] UPGRADES = {"三级", "二级", "一级"};

    public static String upgrade(String current) {
        int upIndex = 0;
        for (int i = 0; i < UPGRADES.length; i++) {
            if (UPGRADES[i].equals(current)) {
                upIndex = i + 1;
                break;
            }
        }
        return UPGRADES[upIndex];
    }


    public static String getIfPresent(Object value) {
        if (value == null) {
            value = "";
        }
        return String.valueOf(value);
    }

}
